from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.executors.pool import ProcessPoolExecutor

executors = {
    'default': ProcessPoolExecutor(3)
}
scheduler = BlockingScheduler(executors=executors)

def print_test():
    print('1'*20)
# 使用interval,指定从开始时间start_date到结束时间end_date,每隔3秒执行一次
scheduler.add_job(print_test,
                  'interval',
                  start_date ='2019-08-19 15:41:16',
                  end_date='2019-08-19 15:42:00',
                  second =3
                  )
if __name__ == '__main__':
    scheduler.start()